<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../static/assets/css/layui.css">
<link rel="stylesheet" href="../static/assets/css/view.css" />
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" href="../static/assets/css/amazeui.css" />
<link rel="stylesheet"
	href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../static/assets/css/core.css" />
<link rel="stylesheet" href="../static/assets/css/menu.css" />
<link rel="stylesheet" href="../static/assets/css/index.css" />
<link rel="stylesheet" href="../static/assets/css/admin.css" />
<link rel="stylesheet" href="../static/assets/css/page/typography.css" />
<link rel="stylesheet" href="../static/assets/css/page/form.css" />
<link rel="stylesheet" type="text/css" href="static/css/common.css" />
<link rel="stylesheet" type="text/css" href="static/css/main.css" />
<style>
.black_overlay {
	display: none;
	position: absolute;
	top: 0%;
	left: 0%;
	width: 100%;
	height: 100%;
	background-color: black;
	z-index: 1001;
	-moz-opacity: 0.8;
	opacity: .80;
	filter: alpha(opacity = 88);
}

.white_content {
	display: none;
	position: absolute;
	top: 25%;
	left: 25%;
	width: 55%;
	height: 55%;
	padding: 20px;
	border: 10px solid orange;
	background-color: white;
	z-index: 1002;
	overflow: auto;
}
</style>
<script type="text/javascript">
	function check(form) {
		if (form.postType.value == '') {
			alert("博文类型不能为空");
			form.postType.focus();
			return false;
		}
		return true;
	}
</script>
<title></title>
</head>
<body class="layui-view-body">
	<div class="layui-content">
		<div class="layui-page-header">
			<div class="pagewrap">

				<h2 class="title">分类管理:</h2>
			</div>

			<div>
				<a href="javascript:void(0)"
					onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'"><i
					class="icon-font">&#xe01e;</i>新增分类</a>
			</div>
		</div>
		<div class="layui-row">
			<div class="layui-card">
				<div class="layui-card-body">
					<div class="form-box">
						<div class="layui-form layui-form-item">
							<div class="layui-inline">

								<c:forEach items="${postType }" var="p">
									<div align="center">
										<a
											href="<%=request.getContextPath() %>/findPostByType?type=${p.type}"><button
												type="submit" class="layui-btn layui-btn-blue">${p.type}</button></a>
										<a
											href="<%=request.getContextPath() %>/deleteType?type=${p.type}"><button
												type="submit" class="layui-btn layui-btn-blue">删除</button></a>
									</div>
								</c:forEach>

							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="light" class="white_content" align="center">
		输入新的分类
		<!-- 		<input placeholder"分类名"  align="center"> -->
		<%-- 		<a href = "<%=request.getContextPath()%>/toaddPostType" ><button >提交</a> --%>
		<form action="<%=request.getContextPath()%>/toaddPostType" method="post">
			分类名称<input type=text name="postType" size="18" value=""><br>
			<input type=submit name="submit1" value="提交" onclick="return check(this.form)">
				<a href = "javascript:void(0)"onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'" ><input type="button" value="退出"></a>
		</form>
	</div>
	<div id="fade" class="black_overlay"></div>
</body>
</html>